home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Devpac 2.12 disk 2.adf / include.cbm / graphics / gels.i < prev    next >
Text File  |  1987-03-31  |  9KB  |  202 lines

  1.     IFND    GRAPHICS_GELS_I
  2. GRAPHICS_GELS_I SET 1
  3. *********************************************************************
  4. *               Commodore-Amiga, Inc.                               *
  5. *      Graphics Library : Gels Definitions                          *
  6. *                                                                   *
  7. *********************************************************************
  8.  
  9.  
  10. *------ VS_vSflags ---------------------------------------------------
  11.  
  12. *   ;-- user-set vSprite flags --
  13. SUSERFLAGS  EQU $00FF         ; mask of all user-settable vSprite-flags
  14.     BITDEF  VS,VSPRITE,0      ; set if vSprite, clear if bob
  15.     BITDEF  VS,SAVEBACK,1     ; set if background is to be saved/restored
  16.     BITDEF  VS,OVERLAY,2      ; set to mask image of bob onto background
  17.     BITDEF  VS,MUSTDRAW,3     ; set if vSprite absolutely must be drawn
  18. *   ;-- system-set vSprite flags --
  19.     BITDEF  VS,BACKSAVED,8    ; this bob's background has been saved
  20.     BITDEF  VS,BOBUPDATE,9    ; temporary flag, useless to outside world
  21.     BITDEF  VS,GELGONE,10     ; set if gel is completely clipped (offscreen)
  22.     BITDEF  VS,VSOVERFLOW,11  ; vSprite overflow (if MUSTDRAW set we draw!)
  23.  
  24.  
  25. *------ B_flags ------------------------------------------------------
  26. *   ;-- these are the user flag bits --
  27. BUSERFLAGS  EQU $00FF         ; mask of all user-settable bob-flags
  28.     BITDEF  B,SAVEBOB,0       ; set to not erase bob
  29.     BITDEF  B,BOBISCOMP,1     ; set to identify bob as animComp
  30. *   ;-- these are the system flag bits --
  31.     BITDEF  B,BWAITING,8      ; set while bob is waiting on 'after'
  32.     BITDEF  B,BDRAWN,9        ; set when bob is drawn this DrawG pass
  33.     BITDEF  B,BOBSAWAY,10     ; set to initiate removal of bob
  34.     BITDEF  B,BOBNIX,11       ; set when bob is completely removed
  35.     BITDEF  B,SAVEPRESERVE,12 ; for back-restore during double-buffer
  36.     BITDEF  B,OUTSTEP,13      ; for double-clearing if double-buffer
  37.  
  38.  
  39. *------ defines for the animation procedures -------------------------
  40.  
  41. ANFRACSIZE  EQU 6
  42. ANIMHALF    EQU $0020
  43. RINGTRIGGER EQU $0001
  44.  
  45. *------ macros --------------------------------------------------------
  46. * these are GEL functions that are currently simple enough to exist as a
  47. * definition.  It should not be assumed that this will always be the case
  48.  
  49. InitAnimate MACRO   * &animKey
  50.        CLR.L   \1
  51.        ENDM
  52.  
  53.  
  54. RemBob      MACRO   * &b
  55.        OR.W    #BF_BOBSAWAY,b_BobFlags+\1
  56.        ENDM
  57.  
  58. *------ VS : vSprite -------------------------------------------------
  59.  STRUCTURE  VS,0    ; vSprite
  60. *   -- SYSTEM VARIABLES --
  61. *   GEL linked list forward/backward pointers sorted by y,x value
  62.     APTR    vs_NextVSprite    ; struct *vSprite
  63.     APTR    vs_PrevVSprite    ; struct *vSprite
  64. *   GEL draw list constructed in the order the bobs are actually drawn, then
  65. *   list is copied to clear list
  66. *   must be here in vSprite for system boundary detection
  67.     APTR    vs_DrawPath       ; struct *vSprite: pointer of overlay drawing
  68.     APTR    vs_ClearPath      ; struct *vSprite: pointer for overlay clearing
  69. *   the vSprite positions are defined in (y,x) order to make sorting
  70. *   sorting easier, since (y,x) as a long integer
  71.     WORD    vs_Oldy           ; previous position
  72.     WORD    vs_Oldx           ;
  73. *   -- COMMON VARIABLES --
  74.     WORD    vs_VSFlags        ; vSprite flags
  75. *   -- USER VARIABLES --
  76. *    the vSprite positions are defined in (y,x) order to make sorting
  77. *    easier, since (y,x) as a long integer
  78.     WORD    vs_Y              ; screen position
  79.     WORD    vs_X
  80.     WORD    vs_Height
  81.     WORD    vs_Width          ; number of words per row of image data
  82.     WORD    vs_Depth          ; number of planes of data
  83.     WORD    vs_MeMask         ; which types can collide with this vSprite
  84.     WORD    vs_HitMask        ; which types this vSprite can collide with
  85.     APTR    vs_ImageData      ; *WORD pointer to vSprite image
  86. *    borderLine is the one-dimensional logical OR of all
  87. *    the vSprite bits, used for fast collision detection of edge
  88.     APTR    vs_BorderLine     ; *WORD: logical OR of all vSprite bits
  89.     APTR    vs_CollMask       ; *WORD: similar to above except this is a 
  90. *    matrix pointer to this vSprite's color definitions (not used by bobs)
  91.     APTR    vs_SprColors      ; *WORD
  92.     APTR    vs_VSBob          ; struct *bob: points home if this vSprite is 
  93.                               ;  part of a bob
  94. *    planePick flag:  set bit selects a plane from image, clear bit selects
  95. *         use of shadow mask for that plane
  96. *    OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  97. *         to bit in planePick) describes whether to fill with 0's or 1's
  98. *    There are two uses for these flags:
  99. *              - if this is the vSprite of a bob, these flags describe how 
  100. *                the bob is to be drawn into memory
  101. *              - if this is a simple vSprite and the user intends on setting 
  102. *                the MUSTDRAW flag of the vSprite, these flags must be set 
  103. *                too to describe which color registers the user wants for 
  104. *                the image
  105.     BYTE    vs_PlanePick
  106.     BYTE    vs_PlaneOnOff
  107.     LABEL   vs_SUserExt       ; user definable
  108.     LABEL   vs_SIZEOF
  109.  
  110.  
  111. *------ BOB : bob ------------------------------------------------------
  112.  
  113.  STRUCTURE  BOB,0     ; bob: blitter object
  114. *   -- COMMON VARIABLES --
  115.     WORD    bob_BobFlags      ; general purpose flags (see definitions below)
  116. *   -- USER VARIABLES --
  117.     APTR    bob_SaveBuffer    ; *WORD pointer to the buffer for background 
  118. *    save used by bobs for "cookie-cutting" and multi-plane masking
  119.     APTR    bob_ImageShadow   ; *WORD
  120. *    pointer to BOBs for sequenced drawing of bobs
  121. *      for correct overlaying of multiple component animations
  122.     APTR    bob_Before        ; struct *bob: draw this bob before bob pointed
  123.                               ; to by before
  124.     APTR    bob_After         ; struct *bob: draw this bob after bob pointed
  125.                               ; to by after
  126.     APTR    bob_BobVSprite    ; struct *vSprite: this bob's vSprite definition
  127.     APTR    bob_BobComp       ; struct *animComp: pointer to this bob's 
  128.                               ; animComp def
  129.     APTR    bob_DBuffer       ; struct dBufPacket: pointer to this bob's 
  130.                               ; dBuf packet
  131.     LABEL   bob_BUserExt      ; bob user extension
  132.     LABEL   bob_SIZEOF
  133.  
  134. *------ AC : animComp ------------------------------------------------
  135.  
  136.  STRUCTURE  AC,0    ; animComp
  137. *   -- COMMON VARIABLES --
  138.     WORD    ac_CompFlags      ; animComp flags for system & user
  139. *    timer defines how long to keep this component active:
  140. *      if set non-zero, timer decrements to zero then switches to nextSeq
  141. *      if set to zero, animComp never switches
  142.     WORD    ac_Timer
  143. *   -- USER VARIABLES --
  144. *    initial value for timer when the animComp is activated by the system
  145.     WORD    ac_TimeSet
  146. *    pointer to next and previous components of animation object
  147.     APTR    ac_NextComp       ; struct *animComp
  148.     APTR    ac_PrevComp       ; struct *animComp
  149. *    pointer to component component definition of next image in sequence
  150.     APTR    ac_NextSeq        ; struct *animComp
  151.     APTR    ac_PrevSeq        ; struct *animComp
  152.     APTR    ac_AnimCRoutine   ; address of special animation procedure
  153.     WORD    ac_YTrans         ; initial y translation (if this is a component)
  154.     WORD    ac_XTrans         ; initial x translation (if this is a component)
  155.     APTR    ac_HeadOb         ; struct *animOb
  156.     APTR    ac_AnimBob        ; struct *bob
  157.     LABEL   ac_SIZE
  158.  
  159. *------ AO : animOb --------------------------------------------------
  160.  
  161.  STRUCTURE  AO,0    ; animOb
  162. *   -- SYSTEM VARIABLES --
  163.     APTR    ao_NextOb         ; struct *animOb
  164.     APTR    ao_PrevOb         ; struct *animOb
  165. *    number of calls to Animate this animOb has endured
  166.     LONG    ao_Clock
  167.     WORD    ao_AnOldY         ; old y,x coordinates
  168.     WORD    ao_AnOldX         ;
  169. *   -- COMMON VARIABLES --
  170.     WORD    ao_AnY            ; y,x coordinates of the animOb
  171.     WORD    ao_AnX            ;
  172. *   -- USER VARIABLES --
  173.     WORD    ao_YVel           ; velocities of this object
  174.     WORD    ao_XVel           ;
  175.     WORD    ao_XAccel         ; accelerations of this object
  176.     WORD    ao_YAccel         ;   !!! backwards !!!
  177.     WORD    ao_RingYTrans     ; ring translation values
  178.     WORD    ao_RingXTrans     ;
  179.     APTR    ao_AnimORoutine   ; address of special animation procedure
  180.     APTR    ao_HeadComp       ; struct *animComp: pointer to first component
  181.     LABEL   ao_AUserExt       ; animOb user extension
  182.     LABEL   ao_SIZEOF
  183.  
  184.  
  185. *------ DBP : dBufPacket ---------------------------------------------
  186. * dBufPacket defines the values needed to be saved across buffer to buffer
  187. *   when in double-buffer mode
  188.  
  189.  STRUCTURE  DBP,0             ; dBufPacket
  190.     WORD    dbp_BufY          ; save the other buffers screen coordinates
  191.     WORD    dbp_BufX          ;
  192.     APTR    dbp_BufPath       ; struct *vSprite: carry the draw path over
  193.                               ; the gap
  194. *    these pointers must be filled in by the user
  195. *    pointer to other buffer's background save buffer
  196.     APTR    dbp_BufBuffer     ; *WORD
  197. *    pointer to other buffer's background plane pointers
  198.     APTR    dbp_BufPlanes     ; **WORD
  199.     LABEL   dbp_SIZEOF
  200.  
  201.     ENDC
  202.